feat(search-issues): Support recommended sort - #1161
Conversation
dcramer
left a comment
There was a problem hiding this comment.
I found one project-scoping inconsistency worth addressing.
| projectSlug?: string; | ||
| query?: string | null; | ||
| sortBy?: "user" | "freq" | "date" | "new"; | ||
| sortBy?: "user" | "freq" | "date" | "new" | "recommended"; |
There was a problem hiding this comment.
P2: recommended will not use the feature-flagged v2 scorer when projectSlug is present. listIssues() switches to the deprecated project issues endpoint below, but Sentry's recommended → recommended_v2 mapping exists only in OrganizationGroupIndexEndpoint; ProjectGroupIndexEndpoint calls prep_search() directly. This makes the same sort behave differently for project-scoped requests. Could we use the organization issues endpoint for project-scoped searches too and pass a project filter/ID?
Add `recommended` (Sentry's prioritized ranking) to the search_issues tool sort enum, the embedded search-issues agent, and the listIssues API client. The issues API already accepts sort=recommended; the tools just didn't offer it, so an agent could not ask for Sentry's default prioritized ranking. Regenerated toolDefinitions.json is hand-synced to the schema change; CI generate-definitions will confirm. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
833663a to
4cbcd89
Compare
roggenkemper
left a comment
There was a problem hiding this comment.
Re-reviewed against the latest main: no additional findings. The earlier project-scoping concern is now addressed because listIssues() consistently uses the organization issues endpoint and passes projectId as a query parameter, so recommended reaches the endpoint that performs the org-level scorer selection. The schema, agent prompt/output, generated definitions, and request passthrough coverage are aligned.
The test/typecheck/security checks passed. The failing Warden rollup is infrastructure-only: code-review and mcp-audit stopped after repeated provider-unavailable errors and reported no findings.
Adds
recommended(Sentry's prioritized ranking) to thesearch_issuessort options — the tool enum, the embedded search-issues agent, and thelistIssuesAPI client. The issues API already acceptssort=recommended; the agent tooling just didn't expose it, so an agent couldn't ask for Sentry's default prioritized ranking.recommendedneeds no client-side flag: the endpoint accepts it unconditionally (mapping to the v2 scorer internally when the org has the experimental flag).toolDefinitions.jsonis hand-synced to the schema change; CIgenerate-definitionswill confirm it matches.